﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using HNG.LIB.Common;
using System.Data;
using HNG.Portal.BLL;
using HNG.Portal.DAL;
using HNG.Portal.DAL.EntityClasses;
using HNG.Portal.DAL.FactoryClasses;
using HNG.Portal.DAL.HelperClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;
using System.Web.Security;
using HNG.LIB.Localization;
using HNG.LIB.Common;
public partial class AdminPortal_Masters_Home : System.Web.UI.MasterPage
{
    TblThanhVienManager _TblThanhVienManager = new TblThanhVienManager();
    protected void Page_Load(object sender, EventArgs e)
    {
        HttpCookie _cookie = Request.Cookies["InfoLogin"];
        if (_cookie != null)
        {
            string[] strInfo = _cookie.Value.Split(',');
            if (strInfo.Length > 0)
            {
                Session[Constants.SessionTenDangNhap] = strInfo[0];
                Session[Constants.SessionMatKhau] = strInfo[1];
            }
        }

        if (Session[Constants.SessionTenDangNhap] == null || Session[Constants.SessionMatKhau] == null)
        {
            Response.Redirect(ResolveUrl("~/AdminPortal/Login.aspx"));
        }
        DataTable _dtRole = _TblThanhVienManager.GetIDByUserName(Session[Constants.SessionTenDangNhap].ToString());
        if (_dtRole.Rows.Count > 0)
        {
            Session[Constants.SessionUserId] = _dtRole.Rows[0][0].ToString();
        }
    }
}
